﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CRMAdminDashboard.CrmSvc;

namespace CRMAdminDashboard
{
    /// <summary>
    /// Serializable version of UserQuery
    /// </summary>
    [Serializable]
    public class SerializableUserQuery : userquery
    {

        #region Entry Points

        /// <summary>
        /// Make a serializable user out of systemuser
        /// </summary>
        public SerializableUserQuery(userquery uq)
        {
            this.columnsetxml = uq.columnsetxml;
            this.createdby = uq.createdby;
            this.createdon = uq.createdon;
            this.description = uq.description;
            this.fetchxml = uq.fetchxml;
            this.layoutxml = uq.layoutxml;
            this.modifiedby = uq.modifiedby;
            this.modifiedon = uq.modifiedon;
            this.name = uq.name;
            this.ownerid = uq.ownerid;
            this.owningbusinessunit = uq.owningbusinessunit;
            this.querytype = uq.querytype;
            this.returnedtypecode = uq.returnedtypecode;
            this.statecode = uq.statecode;
            this.statuscode = uq.statuscode;
            this.userqueryid = uq.userqueryid;
        }

        /// <summary>
        /// Make a serializable user out of SystemUser
        /// </summary>
        public SerializableUserQuery(UserQuery uq) : this(uq.InnerUserQuery) { }

        /// <summary>
        /// Needed for the serializer
        /// </summary>
        public SerializableUserQuery() { }

        #endregion

    }
}
